<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/base/base.jsp"%>
<%@ include file="/base/database.jsp" %>
	
	<%

		request.setCharacterEncoding("utf-8");
		
		String courseID=request.getParameter("courseID");
		String classID=request.getParameter("classID");
		String courseName=request.getParameter("courseName");
		String year=request.getParameter("year");
		String term=request.getParameter("term");
		String hour=request.getParameter("hour");

		StringBuffer sqlBuff=new StringBuffer();
		sqlBuff.append("update sys_course set courseID=?,classID=?,courseName=?,year=?,term=?,hour=? where courseID=?");
		String sql=sqlBuff.toString();
		
		Connection conn=getConn();
		PreparedStatement pstmt=conn.prepareStatement(sql);
		
		int parameterIndex=1;
		
		pstmt.setString(parameterIndex++, courseID);
		pstmt.setNString(parameterIndex++,classID);
		pstmt.setNString(parameterIndex++,courseName);
		pstmt.setNString(parameterIndex++,year);
		pstmt.setNString(parameterIndex++,term);
		pstmt.setNString(parameterIndex++,hour);
		pstmt.setString(parameterIndex++, courseID);
		
		int c=pstmt.executeUpdate();
		
		if(pstmt!=null){
			pstmt.close();
		}
		if(conn!=null){
			conn.close();
		}
		
		process(request,response,"course_list.jsp");
		
		
		%>